package com.osce.score.mapper;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.csce.domain.entity.score.ScoreExExam;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 考试Mapper接口
 *
 * @author zzx
 * @since 2023-09-05
 */
@Repository
public interface ScoreExExamMapper extends BaseMapper<ScoreExExam> {

    /**
     * 查询考试
     *
     * @param id 考试主键
     * @return 考试
     */
    ScoreExExam selectScoreExExamById(Long id);

    /**
     * 查询考试列表
     *
     * @param scoreExExam 考试
     * @return 考试集合
     */
    List<ScoreExExam> selectScoreExExamList(ScoreExExam scoreExExam);

    /**
     * 新增考试
     *
     * @param scoreExExam 考试
     * @return 结果
     */
    int insertScoreExExam(ScoreExExam scoreExExam);

    /**
     * 修改考试
     *
     * @param scoreExExam 考试
     * @return 结果
     */
    int updateScoreExExam(ScoreExExam scoreExExam);

    /**
     * 删除考试
     *
     * @param id 考试主键
     * @return 结果
     */
    int deleteScoreExExamById(Long id);

    /**
     * 批量删除考试
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteScoreExExamByIds(Long[] ids);

    /**
     * 查询考试时段场地占用情况
     * @param day 天
     * @param startTime 开始时段
     * @param endTime 结束时段
     * @param placeId 房间id
     * @return
     */
    List<Map<String, String>> selectScoreExExamOccupy(@Param("examDate")DateTime day,
                                                      @Param("startTime")String startTime,
                                                      @Param("endTime")String endTime,
                                                      @Param("placeId")Long placeId,@Param("examId")Long examId);

}
